package com.IT.dao;

import java.util.List;

import com.IT.pojo.User;
import org.apache.ibatis.annotations.*;

public interface UserMapper {
    @Select("select * from user")
    List<User> getUser();

    @Select("select * from user where id=#{id}")
    User getUserByID(@Param("id") int id);

    @Insert("insert into user(id,name,pwd) values (#{id},#{name},#{pwd})")
    int addUser(User user);

    @Update("update user set name=#{name},pwd=#{pwd} where id =#{id}")
    int updateUser(User user);
    //一般引用符号都是#{},${}容易被注入，不安全
    @Delete("delete from user where id=#{uid}")
    int deleteUser(@Param("uid") int id);
}
